/**
 * 
 */
package com.meetingshow.meeting.service.util;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseQueryParasBuilder;
import com.meetingshow.meeting.service.model.MeetingTypeQueryParas;

/**
 * @author louyi
 * 
 */
public class MeetingTypeQueryParasBuilder extends BaseQueryParasBuilder {
    public static QueryStruct meetingTypeQueryBuilder(
            QueryStruct queryStruct, MeetingTypeQueryParas meetingTypeQueryParas)
            throws Exception {
        builderInit(meetingTypeQueryParas, queryStruct);

        Map<String, Object> exactMap = queryStruct.getExactMap();
        Map<String, String> mistinessMap = queryStruct.getMistinessMap();

        if (StringUtils.isNotBlank(meetingTypeQueryParas.getTypeId_e())) {
            exactMap.put(MeetingTypeServiceParas.MEETING_TYPE_ID,
                    new Integer(meetingTypeQueryParas.getTypeId_e()));
        }
        
        if (StringUtils.isNotBlank(meetingTypeQueryParas.getTypeName_e())) {
            exactMap.put(MeetingTypeServiceParas.MEETING_TYPE_NAME,
                    meetingTypeQueryParas.getTypeName_e());
        }

        if (StringUtils.isNotBlank(meetingTypeQueryParas.getTypeName())) {
            mistinessMap.put(MeetingTypeServiceParas.MEETING_TYPE_NAME,
                    meetingTypeQueryParas.getTypeName());
        }
        
        pageBuilder(queryStruct, meetingTypeQueryParas);
        
        return queryStruct;
    }
}
